package fr.bordeaux1.planingdesetudiants.view;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wb.swt.SWTResourceManager;

public class AboutDialog extends TitleAreaDialog {
	private Text txtApplicationCr;

	/**
	 * Create the dialog.
	 * @param parentShell
	 */
	public AboutDialog(Shell parentShell) {
		super(parentShell);
	}

	/**
	 * Create contents of the dialog.
	 * @param parent
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		setMessage("A propos");
		setTitle("Planing des étudiants");
		setTitleImage(SWTResourceManager.getImage(AboutDialog.class, "/interrogation.png"));
		Composite container = (Composite) super.createDialogArea(parent);
		container.setLayout(null);
		
		txtApplicationCr = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
		txtApplicationCr.setBounds(0, 0, 444, 146);
		txtApplicationCr.setText("Application résultant du projet de PED \"Planing des étudiants\" à destination de Fabienne Clairand.\r\n\r\nPromotion 2011-2012.\r\n\r\nEtudiants ayant participés au projet :\r\n - Cyril Bourdieu\r\n - Idrissa Fall\r\n - Valentin Féron\r\n - Loullah Ahmedou\r\n - Anthony Roy\r\n\r\nEnseignant responsable :\r\n - Xavier Blanc\r\n");
		txtApplicationCr.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));


		return container;
	}

	/**
	 * Create contents of the button bar.
	 * @param parent
	 */
	@Override
	protected void createButtonsForButtonBar(Composite parent) {
		createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
				true);
	}

	/**
	 * Return the initial size of the dialog.
	 */
	@Override
	protected Point getInitialSize() {
		return new Point(450, 300);
	}
}
